package com.bawei.house.adapter

import android.graphics.Color
import com.bawei.house.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class HouseTypeAdapter:BaseQuickAdapter<String,BaseViewHolder>(R.layout.item_house_type) {
    var selectId="A区"
    override fun convert(helper: BaseViewHolder, item: String) {
        helper.setText(R.id.house_title,item)
        if (selectId==item){
            helper.setTextColor(R.id.house_title,Color.BLUE)
        }else{
            helper.setTextColor(R.id.house_title,Color.BLACK)
        }
    }
    fun setSelectId(id:String,startIndex:Int,endIndex:Int):Int{
        selectId=id
        notifyItemChanged(startIndex)
        notifyItemChanged(endIndex)
        return endIndex
    }
}